#ifndef VXHANDCONTROLLER_H
#define VXHANDCONTROLLER_H

#include <QtGui>

class VxHandController : public QObject
{
	Q_OBJECT
	Q_PROPERTY(QPointF viewPoint READ _getViewPoint WRITE setViewPoint)

public:
	VxHandController(QGraphicsView * view);
	QGraphicsView * view() { return _view; };

	virtual void setViewPoint(QPointF point);


private:

	void _buildStateMachine();

	QPointF _getViewPoint();

protected:
	QPropertyAnimation * _animation;
	QGraphicsItem * _indicator;
	QGraphicsView * _view;
	virtual QPointF validateEndPoint(QPointF point);


private slots:
	void _mouseDragFinished();
	void _cancelMomentum();
	void _beginHandsController();
	void _endHandsController();

public slots:
	void cancelAnimation();

};

#endif // VXHANDCONTROLLER_H
